-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Log output for LocalQueue and ClusterQueue #3605
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 7h3-3mp7y-m4n The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @7h3-3mp7y-m4n! |
Hi @7h3-3mp7y-m4n. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
pkg/queue/manager.go
Outdated
@@ -329,12 +330,14 @@ func (m *Manager) AddOrUpdateWorkloadWithoutLock(w *kueue.Workload) bool { | |||
qKey := workload.QueueKey(w) | |||
q := m.localQueues[qKey] | |||
if q == nil { | |||
log.Printf("LocalQueue for workload not found; queueKey: %s, workload: %s", qKey, w.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it’s much better to return an error here with a message like 'LocalQueue for workload not found' or 'ClusterQueue for workload not found'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for sure :)
pkg/queue/manager.go
Outdated
@@ -20,6 +20,7 @@ import ( | |||
"context" | |||
"errors" | |||
"fmt" | |||
"log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use this logger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll replace it with fmt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need logger at all. You need to return error instead.
@mbobrovskyi: /release-note-edit must be used with a release note block. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
/release-note-edit
|
/assign @gabesaba |
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
pkg/queue/manager.go
Outdated
@@ -329,12 +329,14 @@ func (m *Manager) AddOrUpdateWorkloadWithoutLock(w *kueue.Workload) bool { | |||
qKey := workload.QueueKey(w) | |||
q := m.localQueues[qKey] | |||
if q == nil { | |||
fmt.Println("LocalQueue for workload not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Println("LocalQueue for workload not found") | |
return ErrQueueDoesNotExist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay!
pkg/queue/manager.go
Outdated
return false | ||
} | ||
wInfo := workload.NewInfo(w, m.workloadInfoOptions...) | ||
q.AddOrUpdate(wInfo) | ||
cq := m.hm.ClusterQueues[q.ClusterQueue] | ||
if cq == nil { | ||
fmt.Println("ClusterQueue for workload not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Println("ClusterQueue for workload not found") | |
return ErrClusterQueueDoesNotExist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we do this then we have to change the type of the function cause it was returning a bool and after adding this it should return error ..
so should I add it like you mentioned or anything other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay!
There are some other log lines related to this issue: e.g. these two, as kueue/pkg/controller/core/workload_controller.go Lines 602 to 604 in 2c8e7da
kueue/pkg/controller/core/workload_controller.go Lines 744 to 746 in 2c8e7da
Could you track those down - there may be more than just the two I linked - and update them as well please? |
Yeah, I'll do that as well :) |
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
Hey @mbobrovskyi and @gabesaba, |
pkg/queue/manager.go
Outdated
} | ||
wInfo := workload.NewInfo(w, m.workloadInfoOptions...) | ||
q.AddOrUpdate(wInfo) | ||
cq := m.hm.ClusterQueues[q.ClusterQueue] | ||
if cq == nil { | ||
return false | ||
return errClusterQueueAlreadyExists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return errClusterQueueAlreadyExists | |
return ErrClusterQueueDoesNotExist |
log.V(2).Info("LocalQueue for workload didn't exist or not active; ignored for now") | ||
err := r.queues.AddOrUpdateWorkload(wlCopy) | ||
if err != nil { | ||
log.V(2).Info(err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.V(2).Info(err.Error()) | |
log.V(2).Info(fmt.Sprintf("%s; ignored for now", err)) |
log.V(2).Info("LocalQueue for workload didn't exist or not active; ignored for now") | ||
err := r.queues.AddOrUpdateWorkloadWithoutLock(wlCopy) | ||
if err != nil { | ||
log.V(2).Info(err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.V(2).Info(err.Error()) | |
log.V(2).Info(fmt.Sprintf("%s; ignored for now", err)) |
log.V(2).Info("Queue for updated workload didn't exist; ignoring for now") | ||
err := r.queues.UpdateWorkload(oldWl, wlCopy) | ||
if err != nil { | ||
log.V(2).Info(err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.V(2).Info(err.Error()) | |
log.V(2).Info(fmt.Sprintf("%s; ignored for now", err)) |
log.V(2).Info("LocalQueue for workload didn't exist or not active; ignored for now") | ||
err := r.queues.AddOrUpdateWorkload(wlCopy) | ||
if err != nil { | ||
log.V(2).Info(err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.V(2).Info(err.Error()) | |
log.V(2).Info(fmt.Sprintf("%s; ignored for now", err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To have the same message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for sure I'll add them :)
Yeah, we need to update tests as well. |
I'll share it with you ASAP, Thanks! @mbobrovskyi |
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
@ 7h3-3mp7y-m4n do you think you can address the comments before the 0.10 release? We are planning 4th December. |
Hey @mimowo , I'm pretty positive that I can pull this before the release, If I jump up with some issue I'll mention it here, so no worries :) |
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
I've temporarily suppressed the error checks for some parts. I'd appreciate it if you could guide me in fixing them as well. Thanks! |
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
Hey @mbobrovskyi, @gabesaba can you review it ? Thanks! |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This PR added Log output for LocalQueue and ClusterQueue
Which issue(s) this PR fixes:
Fixes #3527
Special notes for your reviewer:
It added some log output for better debugging without breaking the function..
Does this PR introduce a user-facing change?
NONE